export function getAttendance(data, time1, time2) {
    if (data == null) return '未到课';
    else if (time1 < time2) return '课程尚未开始';
    else return '已到课';
}

export function getFeedbackValid(arragement, feedback) {
    var today = new Date();
    var thatDay = new Date(arragement.course_date + ' ' + arragement.end_time);

    if (today > thatDay && !feedback)
        return 0;
    //可以提交
    else if (today <= thatDay) return 2;
    //由于课程尚未结束而不能提交
    else return 1; //由于已经提交过而不能提交
}

export function getTeacherComment(comment) {
    if (!comment) return '教师还没有评价~';
    else return comment;
}
